<!DOCTYPE html>
<html class="no-js" lang="zh-CN">
  <head>
    <meta charset="utf-8">
    
    <link rel="preload" href="https://linuxsuren.github.io/files/muli-latin-200.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="https://linuxsuren.github.io/files/muli-latin-400.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="https://linuxsuren.github.io/files/muli-latin-800.woff2" as="font" type="font/woff2" crossorigin>

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     
    <title>SuRenPi</title>
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">

    <meta name="viewport" content="width=device-width,minimum-scale=1">
     <meta name="generator" content="Hugo 0.41" />

      
        <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
      

    <link rel="alternate" type="application/rss" href="https://linuxsuren.github.io/blog/devops/index.xml">
    <link href='/dist/main.css' rel='stylesheet' type="text/css" /><script src="/js/chart.js"></script>
<style>
  img.avatar {
    width: 32px;
    display: inline;
  }
</style>
<meta property="og:title" content="" />
<meta property="og:description" content="DevOps相关技术文章" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://linuxsuren.github.io/blog/devops/" />














<meta itemprop="name" content="">
<meta itemprop="description" content="DevOps相关技术文章">

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content=""/>
<meta name="twitter:description" content="DevOps相关技术文章"/>





  </head>
  <body class="ma0 sans-serif bg-primary-color-light">
    
<nav class="bg-primary-color-dark pv4 w-100" role="navigation">

  <div class="center flex-ns flex-wrap items-center justify-start mw9">

    <h1 class="dim f3 lh-solid ml0-ns mr0 mr4-l mv0 pl3 pl4-ns">
      <a href="https://linuxsuren.github.io/" class="link white">
         SuRenPi
      </a>
    </h1>
    <ul class="list ma0 pa0 dn dib-l">
      
        <li class="f5 dib mr4" role="menuitem">
            
          <a href="/blog" class="dim link light-silver">
            博客
              
            
            
          </a>
        </li>
      
        <li class="f5 dib mr4" role="menuitem">
            
          <a href="/translation" class="dim link light-silver">
            翻译
              
            
            
          </a>
        </li>
      
        <li class="f5 dib mr4" role="menuitem">
            
          <a href="/opensource" class="dim link light-silver">
            开源
              
            
            
          </a>
        </li>
      
    </ul>

    <div class="db dib-ns pl3"><form id="site-search-form" action="" role="search">
  <fieldset class="bn ma0 pa0">
    <label class="clip" for="email-address">Search</label>
    <input type="search" id="search-input" class="needs-js bg-left bg-transparent bn f5 input-reset lh-solid mt3 mt0-ns pl4 pv2 w5 white" placeholder="搜索文档" type="text" name="email-address" value="" style="background-image:url('/images/icon-search.png');background-size:16px 16px;">
  </fieldset>
</form>
</div>

    <div class="list ma0 pa0 dn dib-l"><ul class="list ma0 pa0 dn dib-l">

  <li class="f5 dib mr4" role="menuitem">
    <a href="https://linuxsuren.github.io/" class="dim gray"></a>
  </li>

</ul>
</div>

    <span class="absolute mt1 mt2-l pr3 right-0 top-0">

<a class="github-button needs-js link primary-color-dark" href="https://github.com/jenkins-x/jx" data-size="large" data-show-count="false" aria-label="Star jenkins-x/jx on GitHub">Star</a>
</span>

  </div>
</nav>

    
    <main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
      
  
  
  <div class="w-100 ph4 pb5 pb6-ns pt1 mt4 pt3-ns">

  <div class="flex">
    <div class="dn db-l w-20">
        
<nav role="navigation">
  <ul class="list pa0 nl2">
    
  </ul>
</nav>

    </div>

    <div class="w-100 w-80-l ph0 ph4-l">
      <article class="w-100 nested-copy-line-height nested-links nested-img">
        <h1 class="primary-color-dark f2">
          
        </h1>
        <div class=" mid-gray f5 f4-l">
          <p>DevOps相关技术文章</p>

        </div>
      </article>

      

      <div class="flex flex-wrap">
        
        <section class="flex-ns flex-wrap justify-between w-100">
          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-host/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          本文介绍如何把一个 Jenkins 插件托管到 Jenkins 的 Github 上。
创建库 你需要在 GitHub 上申请一个账号，然后，把你的工程提交上去。
提交请求 详细阅读托管要求
在 Jira 上申请一个账号，然后创建一个 issues，等待管理员的审核。
托管 上传 首先，在 Jenkins 的成品库上，用上面 Jira 的账号登陆一次，保证该账号是可用的。
你需要 Fork 上传权限申请，然后，根据要求编写对应的 YAML 文件。发起的 PR 通过以后，你就有了上传插件的权限了。
发布 等一切就绪，你的插件要发布时，只要执行下面的命令：
mvn release:prepare release:perform
      

        <a href="/blog/devops/jenkins-host/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-pipeline-declarative/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          
      

        <a href="/blog/devops/jenkins-pipeline-declarative/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-pipeline-scripted/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
           流水线 本文介绍 Jenkins 的脚本式流水线。
触发器 node('local') { echo 'hello' } properties([ buildDiscarder( logRotator( artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '10' ) ), pipelineTriggers([ cron('H 3,12,17 * * *'), scm('H 3,12,17 * * *') ]) ])  参数化执行 properties([[$class: 'JobRestrictionProperty'], parameters([run(description: '', filter: 'ALL', name: 'Name', projectName: 'Project')]), pipelineTriggers([])] )  
      

        <a href="/blog/devops/jenkins-pipeline-scripted/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-plugin-debug/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          Jenkins 插件调试 运行 在 war 目录下运行：
mvn hpi:run
mvn jenkins-dev:run
mvn jenkins-dev:run -Djenkins.install.runSetupWizard=true -DJENKINS_hOME=. 需要在目录 war 下运行，并保证没有 work 目录
跳过测试 mvn hpi:run -DskipTests 该命令会跳过测试的执行，但还是会编译测试代码的。如果确实想要加快构建速度而跳过测试的话，建议使用这个命令，而不是下面的：
mvn hpi:run -Dmaven.test.skip=true 该命令既不执行测试代码，也不会编译。
指定端口 `mvn hpi:run -Djetty.port=1234&rsquo;
mvn hpi:run -Djenkins.install.runSetupWizard=true
参考 maven-hpi-plugin
      

        <a href="/blog/devops/jenkins-plugin-debug/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-plugin-dev-build/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
           构建 本文介绍如何扩展 Jenkins 的构建（Builder）任务。
流水线 
      

        <a href="/blog/devops/jenkins-plugin-dev-build/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins-plugin-develope/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          Jenkins 插件开发 环境准备 你需要安装好Java和Maven。
创建工程 执行命令 mvn --update-snapshots archetype:generate -Dfilter=io.jenkins.archetypes:，然后，根据提示选择骨架类型，以及当前 Maven 工程的信息。
运行 在工程根目录下执行 mvn hpi:run
访问 http://localhost:8080/jenkins/
Jenkins 版本选择 理论上，你可以任意选择一个喜欢的 Jenkins 版本来开发。但是，处于严谨的做法，同时也是 Jenkins 官方推荐的。你可以到 Jenkins 的下载页面找一个长期支持版本（LTS）。
单元测试 Jenkins 官方提供了单元测试相关的内容。
参考 Extend Jenkins
      

        <a href="/blog/devops/jenkins-plugin-develope/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/jenkins/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          启动 java -jar jenkins.war 这样启动后，就可以通过浏览器访问 http://localhost:8080/jenkins
java -jar jenkins.war --httpPort=1234 设置 Jenkins 的监听端口
      

        <a href="/blog/devops/jenkins/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/k8s/apiserver/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
           ApiServer 
      

        <a href="/blog/devops/k8s/apiserver/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/k8s/kuberctl/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          下载 wget https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl
切换上下文 kubectl config use-context dev
查看上下文 kubectl config current-context
      

        <a href="/blog/devops/k8s/kuberctl/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
            <div class="relative  weight-0">

  <div class="bg-white mb2 pa3 pa4-l gray">
    

    <h1 class="near-black f3">
      <a href="/blog/devops/k8s/minikube/" class="link primary-color dim"></a>
    </h1>

    <div class="lh-copy links">
      
          下载 wget https://github.com/kubernetes/minikube/releases/download/v0.26.1/minikube-linux-amd64
然后，添加可执行权限并移动到执行目录下：
chmodd u+x minikube-linux-amd64 &amp;&amp; mv minikube-linux-amd64 /usr/local/bin/minikue
下载ISO wget https://storage.googleapis.com/minikube/iso/minikube-v0.26.0.iso
      

        <a href="/blog/devops/k8s/minikube/" class="f6 mt2 db link primary-color dim">
          Read More &raquo;
        </a>

    </div>


  </div>
</div>

          
        </section>
      </div>

    </div>

  </div>

</div>


    </main>

    <footer class="bg-primary-color-dark ph4-ns pt4 relative w-100" role="contentinfo">
  <div class="center flex-ns flex-wrap justify-between mw9 w-90">
    <div class="pb3 pt4 w-100 w-50-ns">

      <div class="b f3  light-gray mb3 nested-links tc">
        By the <a href="https://github.com/jenkins-x/jx/contributors" class="link">Jenkins X Authors</a><br/>
      </div>

      <ul class="center f6 list ma0 mv3 pa0 tc"></ul>

      <ul class="center f6 list ma0 mv4 pa0 tc">
        <li class="dib mr3"><a href="https://twitter.com/jenkinsxio" class="dim link light-gray pv2">@jenkinsxio</a>
        </li>
      </ul>

      
    </div>

    <div> 
      <img src="http://jenkins-x.io/img/profile.png" with="100" height="100">
    </div>

  </div>

  <div class="f7 gray mb5 mb0-ns ph3 w-100"> 
    <p class="dib mr4">Jenkins&reg; is a registered trademark of <a href="https://www.spi-inc.org/" class="link">Software in the Public Interest, Inc.</a></p>
    <p class="dib">Copyright 2018–2018 the original authors.</p>
  </div>


  <div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 w-100"><div  class="globalmenu mobilemenu pb3 dn">
    

<ul class="list hidden dib ph0 ma0 scrolling-touch tc">
  
    <li  class="tl dib ma0 hover-bg-black w-100">
        <a href="/blog" class="ttu f6 link primary-color-light overflow hover-white db brand-font  ma0 w-100 pv3 ph4">
          博客
        </a>
    </li>
  
    <li  class="tl dib ma0 hover-bg-black w-100">
        <a href="/translation" class="ttu f6 link primary-color-light overflow hover-white db brand-font  ma0 w-100 pv3 ph4">
          翻译
        </a>
    </li>
  
    <li  class="tl dib ma0 hover-bg-black w-100">
        <a href="/opensource" class="ttu f6 link primary-color-light overflow hover-white db brand-font  ma0 w-100 pv3 ph4">
          开源
        </a>
    </li>
  
</ul>

</div>
<div  class="docsmenu mobilemenu pb3 dn">
    

<ul class="list dib ph0 ma0 scrolling-touch tc">
  
</ul>

</div>

<div class="flex dn-l justify-between">
  <button class="js-toggle flex-auto dib dn-l f6 tc db mt4-ns ph3 pv2 link mr2 white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".globalmenu">Menu</button>

  <button class="js-toggle flex-auto dib dn-l f6 tc db mt4-ns ph3 pv2 link white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".docsmenu">Docs Menu</button>
</div>
</div>

</footer>

    <script src="/dist/app.bundle.js"></script>

<script async defer src="https://buttons.github.io/buttons.js"></script>


  </body>
</html>
